import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MessagePayHistoryVO, MessagePayHistoryForm, MessagePayHistoryQuery } from '@/api/system/messagePayHistory/types';

/**
 * 查询短信套餐购买记录列表
 * @param query
 * @returns {*}
 */

export const listMessagePayHistory = (query?: MessagePayHistoryQuery): AxiosPromise<MessagePayHistoryVO[]> => {
    return request({
        url: '/system/messagePayHistory/list',
        method: 'get',
        params: query
    });
};

/**
 * 查询短信套餐购买记录详细
 * @param id
 */
export const getMessagePayHistory = (id: string | number): AxiosPromise<MessagePayHistoryVO> => {
    return request({
        url: '/system/messagePayHistory/' + id,
        method: 'get'
    });
};

/**
 * 新增短信套餐购买记录
 * @param data
 */
export const addMessagePayHistory = (data: MessagePayHistoryForm) => {
    return request({
        url: '/system/messagePayHistory',
        method: 'post',
        data: data
    });
};

/**
 * 修改短信套餐购买记录
 * @param data
 */
export const updateMessagePayHistory = (data: MessagePayHistoryForm) => {
    return request({
        url: '/system/messagePayHistory',
        method: 'put',
        data: data
    });
};

/**
 * 删除短信套餐购买记录
 * @param id
 */
export const delMessagePayHistory = (id: string | number | Array<string | number>) => {
    return request({
        url: '/system/messagePayHistory/' + id,
        method: 'delete'
    });
};